package com.wayne.testapp.activity;

import android.app.ProgressDialog;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.ogaclejapan.smarttablayout.SmartTabLayout;
import com.wayne.testapp.R;

import butterknife.ButterKnife;
import butterknife.InjectView;

public class TestViewActivity extends BaseActivity {
    @InjectView(R.id.rv)
    RecyclerView rv;

    private GridLayoutManager manager;
    private Myadapter myadapter;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.act_test_tab);
        ButterKnife.inject(this);

        manager = new GridLayoutManager(this, 3);
        manager.setOrientation(LinearLayoutManager.VERTICAL);
        rv.setLayoutManager(manager);
        myadapter = new Myadapter(this);
        rv.setAdapter(myadapter);
        showLoading();

    }
    ProgressDialog pd;
    private void showLoading() {
        pd = ProgressDialog.show(this,"提示","加载中");
    }

    public class Myadapter extends RecyclerView.Adapter{
        private Context context;

        public Myadapter(Context context) {
            this.context = context;
        }

        @Override
        public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            View v = View.inflate(context,R.layout.item_recycle,null);

            MyHolder holder = new MyHolder(v);
            return holder;
        }

        @Override
        public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {

        }

        public class MyHolder extends RecyclerView.ViewHolder{

            public MyHolder(View itemView) {
                super(itemView);
            }

        }



        @Override
        public int getItemCount() {
            return 66;
        }
    }
}
